<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        var arr2 = [5, 2, 11, 3, 4, 1];

        var result = arr2.sort(); // 将数组 arr2 进行排序

        console.log("arr2 =" + JSON.stringify(arr2));
        console.log("result =" + JSON.stringify(result));
    </script>
</body>

</html>